package com.liuluo.homework1025hou.domain

import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import java.io.Serializable

/**
 *
 * @TableName customer
 */
@TableName("customer")
data class Customer(
        var id: Int? = null,
        var account: String,
        var password: String,
        var role: Int? = null
) : Serializable {

    @TableField(exist = false)
    var serialVersionUID: Long = 1L

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other == null || javaClass != other.javaClass) return false
        other as Customer
        if (id != other.id) return false
        if (account != other.account) return false
        if (password != other.password) return false
        if (role != other.role) return false
        return true
    }

    override fun hashCode(): Int {
        var result = id?.hashCode() ?: 0
        result = 31 * result + (account?.hashCode() ?: 0)
        result = 31 * result + (password?.hashCode() ?: 0)
        result = 31 * result + (role?.hashCode() ?: 0)
        return result
    }

    override fun toString(): String {
        return "Customer(id=$id, account=$account, password=$password, role=$role)"
    }
}
